<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <title>欢迎页</title>
</head>
<body>

<div id="wrapper" class="basicBody">
    <div class="gray-bg">
        <div class="wrapper wrapper-content  animated fadeInRight">
            <div class="topBox">
                <div class="titleBorder "><span class="titlePiece"></span><span class="orderInfoTitleFont">基本信息</span>
                </div>
                <div class="contentBox">
                    <div class="logoBox">
                        <c:choose>
                            <c:when test="${tenant.tenantLogoImg!=null && tenant.tenantLogoImg!=''}">
                                <img src="${uploadPath}${tenant.tenantLogoImg}" alt="">
                            </c:when>
                            <c:otherwise>
                                <img src="${ctx}/statics/img/defaultLogo.png" alt="">
                            </c:otherwise>
                        </c:choose>
                        <%--<img src="${ctx}/statics/img/newEdition/kyLogo1.jpg" alt="">--%>
                    </div>
                    <ul class="userLoginMsg">
                        <li>
                            <c:choose>
                                <c:when test="${user!=null && user.userType == '0'}">
                                    <div class="loginMsgLabel">运营商</div>
                                    <div class="loginMsgDetail">${tenant.tenantName}</div>
                                </c:when>
                                <c:when test="${user!=null && user.userType == '1'}">
                                    <div class="loginMsgLabel">分销商</div>
                                    <div class="loginMsgDetail">${operator.tenantOperatorCode}:${operator.operatorName}</div>
                                </c:when>
                                <c:when test="${user!=null && user.userType == '2'}">
                                    <div class="loginMsgLabel">企业帐户</div>
                                    <div class="loginMsgDetail">${enterprise.enterpriseMobile}:${enterprise.enterpriseName}</div>
                                </c:when>
                                <c:otherwise>
                                    <div class="loginMsgLabel">用户类型</div>
                                    <div class="loginMsgDetail">无</div>
                                </c:otherwise>
                            </c:choose>
                        </li>
                        <li>
                            <div class="loginMsgLabel">登录账号</div>
                            <div class="loginMsgDetail">${user.loginName}</div>
                        </li>
                        <li>
                            <div class="loginMsgLabel">注册时间</div>
                            <div class="loginMsgDetail"><fmt:formatDate value="${user.createdTime}"
                                                                        pattern="yyyy-MM-dd HH:mm:ss"/></div>
                        </li>
                        <li>
                            <div class="loginMsgLabel">最后登录时间</div>
                            <div class="loginMsgDetail"><fmt:formatDate value="${user.lastLoginTime}"
                                                                        pattern="yyyy-MM-dd HH:mm:ss"/></div>
                        </li>
                        <li>
                            <div class="loginMsgLabel">最后登录IP</div>
                            <div class="loginMsgDetail">${user.lastLoginIp}</div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="betweenBox">
                <div class="betweenLeftBox">
                    <div class="titleBorder "><span class="titlePiece"></span><span
                            class="orderInfoTitleFont">登录密码</span></div>
                    <div class="setProject">
                        <img src="${ctx}/statics/img/newEdition/setPwdIcon.png" alt="">
                        <div class="explainContent">安全性高的密码可以使帐号更安全。建议您定期更换密码，
                            设置一个包含字母，符号或数字中至少两项且长度超过6位
                            的密码。
                        </div>
                        <button type="button" class="setButton" onclick="modifyPwd()">修改</button>
                    </div>
                </div>
                <div class="betweenRightBox">
                    <div class="titleBorder "><span class="titlePiece"></span><span
                            class="orderInfoTitleFont">手机绑定</span></div>
                    <div class="setProject">
                        <img src="${ctx}/statics/img/newEdition/setMobileIcon.png" alt="">
                        <div class="explainContent">您已绑定了手机${user.mobile}[您的手机号可以直接用于登录
                            、找回密码等
                        </div>
                        <button type="button" class="setButton" onclick="modifyMobile()">修改</button>
                    </div>
                </div>
            </div>
            <c:choose>
            <c:when test="${user.userType !=null && user.userType == '0'}">
            <div class="bottomBox">
                <div class="bottomLeftBox">
                    <div class="titleBorder "><span class="titlePiece"></span><span
                            class="orderInfoTitleFont">电子邮箱</span></div>
                    <div class="setProject">
                        <img src="${ctx}/statics/img/newEdition/setEmailIcon.png" alt="">
                        <div class="explainContent">您已绑定了邮箱${user.email} [瑞晨云充发送的各类系统、营销、服务通知将发
                            送到您的备用邮箱
                        </div>
                        <button type="button" class="setButton" onclick="modifyEmail()">修改</button>
                    </div>
                </div>
                <div class="bottomRightBox">
                    <div class="titleBorder "><span class="titlePiece"></span><span
                            class="orderInfoTitleFont">运营商logo</span></div>
                    <div class="setProject">
                        <img src="${ctx}/statics/img/newEdition/setLogoIcon.png" alt="">
                        <div class="explainContent">您可以上传自己公司的logo替换左上角的默认图片</div>
                        <button type="button" class="setButton" onclick="modifyLogo()">修改</button>
                    </div>
                </div>
                </c:when>
                </c:choose>
            </div>
        </div>
    </div>
</div>

<script>
    function modifyPwd() {
        location.href = jsctx + "/tenant/user/modifyPwd";
    };

    function modifyMobile() {
        location.href = jsctx + "/tenant/user/modifyMobile";
    };

    function modifyEmail() {
        location.href = jsctx + "/tenant/user/modifyEmail";
    };

    function modifyLogo() {
        location.href = jsctx + "/tenant/user/modifyLogo";
    };
</script>
</body>
</html>